#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.


AC_PREREQ([2.63])
AC_INIT([bls], [0], [740936897@qq.com])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_AWK
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB

AC_DEFINE_UNQUOTED(BLS_VERSION,	["0.1.`git rev-list --all|wc -l`"], [bls version])
AC_DEFINE_UNQUOTED(BLS_BUILD_DATE,	["`date`"],		[bls build time])

TOP_INCLUDE="\${top_builddir}/include -I\${top_builddir}/include/mcore -I\${top_builddir}/include/mnetwork"
AC_SUBST(TOP_INCLUDE)

TP_INCLUDE="\${top_builddir}/3rdparty/st-1.9/obj -I\${top_builddir}/3rdparty/http-parser-2.1 -I\${top_builddir}/3rdparty/libconhash"
AC_SUBST(TP_INCLUDE)

TOP_LIBS="\${top_builddir}/src/mnetwork -lmnetwork -L\${top_builddir}/src/mcore -lmcore"
AC_SUBST(TOP_LIBS)

TP_LIBS="\${top_builddir}/3rdparty/st-1.9/obj/libst.a -L\${top_builddir}/3rdparty/http-parser-2.1 -lhttp_parser -L\${top_builddir}/3rdparty/openssl-1.0.1c/ -lssl -lcrypto -L\${top_builddir}/3rdparty/libconhash/bin -lconhash"
AC_SUBST(TP_LIBS)

# Checks for typedefs, structures, and compiler characteristics.
#AC_HEADER_STDBOOL
#AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T

# Checks for library functions.
AC_FUNC_FORK
AC_CHECK_FUNCS([clock_gettime \
        dup2 \
        gethostbyname \
        gettimeofday \
        inet_ntoa \
        memmove \
        memset \
        mkdir \
        munmap \
        select \
        socket \
        strchr \
        strdup \
        strerror \ 
        strtol \
        strtoul \
        pthread_create \
        epoll_ctl])

AC_CONFIG_FILES([Makefile
				 src/Makefile
                 src/mcore/Makefile
                 src/mnetwork/Makefile
                 src/bls/Makefile
                 include/Makefile
                 include/mcore/Makefile
                 include/mnetwork/Makefile])
#AC_CONFIG_SUBDIRS([])
AC_OUTPUT
